

package com.painpointcloud.common.util.core;

import java.io.Serializable;
import java.util.List;
/**
 * 分页工具类
 *
 * @author kevin
 *
 */
public class Page<T> implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private List<T> list; 		//保存查询的结果集合
	private Long totalRecord; 	//总记录数
	private Integer pageSize; 	 	//页面显示的数目
	private Long totalPage; 	//总页数
	private Integer currentPage; 	//当前页码

	public Page(Integer currentPage, Integer pageSize, Long totalRecord, List<T> list) {
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.totalRecord = totalRecord;
		this.list = list;
		this.totalPage = (totalRecord + pageSize - 1) / pageSize;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public Long getTotalRecord() {
		return totalRecord;
	}

	public void setTotalRecord(Long totalRecord) {
		this.totalRecord = totalRecord;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Long getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(Long totalPage) {
		this.totalPage = totalPage;
	}

	public Integer getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}
}
